import request from '@/utils/request'
export function getChapterList({ id, page, keyword }) {
  return request({
    url: '/admin/course/courseChapterList',
    method: 'get',
    params: { id, page, keyword }
  })
}
export function upDateChapterStatus({ type, id, is_main, is_good }) {
  return request({
    url: '/admin/course/updateCourseChapterStatus',
    method: 'post',
    data: { type, id, is_main, is_good }
  })
}
export function setChapterNameOrPrice({ id, chapter_title, chapter_price }) {
  return request({
    url: '/admin/course/updateCourseChapter',
    method: 'post',
    data: { id, chapter_title, chapter_price }
  })
}
export function addOrEditChapterItem({ chapter_id, id, chapter_size, chapter_video_url, chapter_title, chapter_price, chapter_video_cover, osskey, sale_num }) {
  return request({
    url: '/admin/course/addCourseChapter',
    method: 'post',
    data: { chapter_id, id, chapter_size, chapter_video_url, chapter_title, chapter_price, chapter_video_cover, osskey, sale_num }
  })
}
export function getChapterDetail(id) {
  return request({
    url: '/admin/course/editCourseChapter',
    method: 'get',
    params: { id }
  })
}
export function deleteChapterItem(id) {
  return request({
    url: '/admin/course/deleteCourseChapter',
    method: 'post',
    data: { id }
  })
}
export function getChapterCommentList(page) {
  return request({
    url: '/admin/course/CourseChapterCommentList',
    method: 'get',
    params: { page }
  })
}
export function sendMessage({ id, content }) {
  return request({
    url: '/admin/course/commentReply',
    method: 'post',
    params: { id, content }
  })
}
export function setMessageHide({ id, is_hide }) {
  return request({
    url: '/admin/course/commentIsHide',
    method: 'post',
    params: { id, is_hide }
  })
}
